home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Mania 6
/
MacMania 6.toast
/
/
Multimedia & Desktop
/
VideoToolbox
/
VideoToolboxSources
/
SetCrsrState.c
< prev
next >
Wrap
Text File
|
1997-05-30
|
2KB
|
64 lines
/*
SetCrsrState.c
Macintosh develop Q&A in the June 1997 issue of MacTech documents some low memory globals
relevant to hiding/showing the cursor. The note gives the usual disclaimer saying
these globals might go away in the future.
Apparently CrsrVis is Boolean, 1 when the cursor is visible and 0 when it's hidden.
As I read their example, setting CrsrVis to zero fools CopyBits into thinking the cursor is
hidden, but doesn't actually hide it. Their example also decrements CrsrState.
Apparently CrsrState is a negative integer. 0 means cursor is visible. It's
decremented by 1 by each call to HideCursor and incremented by ShowCursor. Apple's
routines will never increase it beyond 0. I don't understand why the Q&A note says CrsrState
is a "word", but the code examples only access a byte. I followed the code and access
it as a byte.
REFERENCE:
ftp://ftp.mactech.com/mactech/src/13.06/
http://devworld.apple.com/dev/qa/qd/qd45.html
http://devworld.apple.com/dev/qa/ops/ops13.html
HISTORY:
5/30/97 dgp wrote it, based on Q&A code.
*/
#if 0
enum {
CrsrRect = 0x83C, /*[GLOBAL VAR] Cursor hit rectangle [8 bytes]*/
TheCrsr = 0x844, /*[GLOBAL VAR] Cursor data, mask & hotspot [68 bytes]*/
CrsrAddr = 0x888, /*[GLOBAL VAR] Address of data under cursor [long]*/
CrsrSave = 0x88C, /*[GLOBAL VAR] data under the cursor [64 bytes]*/
CrsrVis = 0x8CC, /*[GLOBAL VAR] Cursor visible? [byte]*/
CrsrBusy = 0x8CD, /*[GLOBAL VAR] Cursor locked out? [byte]*/
CrsrNew = 0x8CE, /*[GLOBAL VAR] Cursor changed? [byte]*/
CrsrState = 0x8D0, /*[GLOBAL VAR] Cursor nesting level [word]*/
CrsrObscure = 0x8D2 /*[GLOBAL VAR] Cursor obscure semaphore [byte]*/
};
#endif
#include <VideoToolbox.h>
#define CrsrVis *(unsigned char *)0x8CC // Cursor visible?
#define CrsrState *(unsigned char *)0x8d0 // Cursor hiding level
void SetCrsrVis(unsigned char cursorVisible)
{
CrsrVis=cursorVisible;
}
unsigned char GetCrsrVis(void)
{
return CrsrVis;
}
short GetCrsrState(void)
{
return CrsrState;
}
void SetCrsrState(short val)
{
CrsrState=val;
}